﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:PresentationOptions="http://schemas.microsoft.com/winfx/2006/xaml/presentation/options"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:props="clr-namespace:ScrumFactory.Windows.Properties"
                    xmlns:SF_Helpers="clr-namespace:ScrumFactory.Windows.Helpers;assembly=ScrumFactory.Windows.Helpers"
                    xmlns:SF_Ext="clr-namespace:ScrumFactory.Windows.Helpers.Extensions;assembly=ScrumFactory.Windows.Helpers"                    
                    xmlns:SF_Converters="clr-namespace:ScrumFactory.Windows.Helpers.Converters;assembly=ScrumFactory.Windows.Helpers"
                    xmlns:sys="clr-namespace:System;assembly=mscorlib">


    <SF_Converters:MemberAvatarUrlConverter x:Key="MemberAvatarUrlConverter"/>

    <SF_Converters:HalfValueConverter x:Key="HalfValueConverter"/>

    <SF_Converters:HalfPointConverter x:Key="HalfPointConverter"/>

    <Style x:Key="WorkedHoursProgressBar" TargetType="ProgressBar">
        <Setter Property="Maximum" Value="160"/>
        <Setter Property="Height" Value="30"/>
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
        <Setter Property="Margin" Value="10,0,10,0"/>        
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ProgressBar">
                    <Grid>
                        <ProgressBar 
                            Maximum="{TemplateBinding Maximum}" 
                            Value="{Binding MonthWorkedHours}" 
                            Foreground="{StaticResource ProgressBarLeftBackground}" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}" />
                        <TextBlock 
                            Text="{Binding MonthWorkedHours, StringFormat={x:Static props:Resources.N_hrs_this_month}}" 
                            HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White" FontWeight="Bold" Opacity="0.7"/>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>            
        </Setter>
    </Style>

    <Style x:Key="CoverBorder" TargetType="Border">
        <Setter Property="CornerRadius" Value="3"/>
        <Setter Property="Background" Value="{StaticResource CoverAreaBrush}"/>        
    </Style>

    <Style x:Key="BacklogItemProgressBarBorder" TargetType="ContentControl">        
        <Setter Property="Height" Value="30"/>
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
                    
                        <SF_Helpers:PixelBorder
                        HorizontalAlignment="Stretch"
                        Height="{TemplateBinding Height}"                        
                        BorderThickness="1" >
                            <Grid>
                                <Border HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="White">
                                    <Border.RenderTransformOrigin>
                                        <Point X="1" Y="0"/>
                                    </Border.RenderTransformOrigin>
                                    <Border.RenderTransform>
                                        <ScaleTransform ScaleX="{Binding PctHoursLeft}" />
                                    </Border.RenderTransform>
                                </Border>
                                <TextBlock 
                                    HorizontalAlignment="Center" VerticalAlignment="Center" Padding="0" Margin="0" 
                                    Text="{Binding HoursLeft}" Opacity="0.5" Foreground="Gray" FontWeight="Bold"/>
                            </Grid>

                        <SF_Helpers:PixelBorder.Style>
                                <Style>
                                    <Setter Property="Border.BorderBrush" Value="{StaticResource ProgressBarBorder}"/>
                                    <Setter Property="Border.Background" Value="{StaticResource ProgressBarLeftBackground}"/>
                                    <Style.Triggers>
                                        <DataTrigger Binding="{Binding IsHoursLeftOverLimit}" Value="1">
                                            <Setter Property="Border.Background" Value="{StaticResource ProgressBarLeftLimit1Background}"/>
                                        </DataTrigger>
                                        <DataTrigger Binding="{Binding IsHoursLeftOverLimit}" Value="2">
                                            <Setter Property="Border.Background" Value="{StaticResource ProgressBarLeftLimit2Background}"/>
                                        </DataTrigger>
                                    </Style.Triggers>
                                </Style>
                        </SF_Helpers:PixelBorder.Style>
                        <SF_Helpers:PixelBorder.ToolTip>
                            <ItemsControl ItemsSource="{Binding Item.PlannedHours}">
                                <ItemsControl.ItemsPanel>
                                    <ItemsPanelTemplate>
                                        <StackPanel Orientation="Horizontal"/>
                                    </ItemsPanelTemplate>
                                </ItemsControl.ItemsPanel>
                                <ItemsControl.ItemTemplate>
                                    <DataTemplate>
                                        <Border Margin="3,0,3,0" Padding="3" Background="#353535">
                                            <StackPanel Orientation="Vertical">
                                                <TextBlock Text="{Binding Hours}" HorizontalAlignment="Center"  FontWeight="Bold" FontSize="{StaticResource BigFontSize}" Foreground="White"/>
                                                <TextBlock Text="{Binding Role.RoleShortName}" HorizontalAlignment="Center" FontWeight="Normal"/>
                                            </StackPanel>
                                        </Border>
                                    </DataTemplate>
                                </ItemsControl.ItemTemplate>
                            </ItemsControl>
                        </SF_Helpers:PixelBorder.ToolTip>
                    </SF_Helpers:PixelBorder>
                       
                        
                    
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="Separator">
        <Setter Property="Visibility" Value="Collapsed"/>
        <!--<Setter Property="Margin" Value="5"/>
        <Setter Property="BorderThickness" Value="1,1,1,1"/>
        <Setter Property="BorderBrush" >
            <Setter.Value>
                <SolidColorBrush Color="{StaticResource Green1Color}"/>
            </Setter.Value>
        </Setter>-->
    </Style>
    

    <Style x:Key="MouseOverBorder" TargetType="{x:Type Border}">
        <Setter Property="Cursor" Value="Hand"/>
        <Setter Property="CornerRadius" Value="0"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Style.Triggers>
            <Trigger Property="Border.IsMouseOver" Value="True">
                <Setter Property="Border.Background" Value="{StaticResource MouseOverBackgroundBrush}"/>
                <Setter Property="Border.BorderBrush" Value="{StaticResource MouseOverBorderBrush}"/>
                <Setter Property="TextBlock.Foreground" Value="{StaticResource MouseOverForegroundBrush}"/>
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="MouseOverListBorder" TargetType="{x:Type Border}">
        <Setter Property="Cursor" Value="Hand"/>
        <Setter Property="CornerRadius" Value="0"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Style.Triggers>
            <Trigger Property="Border.IsMouseOver" Value="True">
                <Setter Property="Border.Background" Value="{StaticResource MouseOverListBackgroundBrush}"/>
                <Setter Property="Border.BorderBrush" Value="{StaticResource MouseOverListBorderBrush}"/>                
            </Trigger>
        </Style.Triggers>
    </Style>



    <Style x:Key="MemberImageControlStyle" TargetType="{x:Type ContentControl}">
        <Setter Property="Width" Value="50"/>
        <Setter Property="Height" Value="50"/>        
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
                    <Grid>
                        <Image                         
                            Margin="3"
                            Source="/Images/contact.png" Width="32" Height="32" HorizontalAlignment="Center" VerticalAlignment="Center">
                            <Image.Style>
                                <Style>
                                    <Style.Triggers>
                                        <DataTrigger Binding="{Binding IsContactMember}" Value="False">
                                            <Setter Property="Image.Visibility" Value="Collapsed"/>
                                        </DataTrigger>
                                    </Style.Triggers>
                                </Style>
                            </Image.Style>
                        </Image>

                        
                        <Ellipse x:Name="ellipse" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}">
                                                        
                            <Ellipse.Style>
                                <Style>                                    
                                    <Setter Property="Ellipse.Fill" Value="{StaticResource MemberTodayPlannedBrush}"/>
                                    <Setter Property="Ellipse.Stroke" Value="{StaticResource MemberTodayPlannedBorderBrush}"/>
                                    <Style.Triggers>
                                        <DataTrigger Binding="{Binding IsContactMember}" Value="True">
                                                <Setter Property="Ellipse.Visibility" Value="Collapsed"/>
                                        </DataTrigger>
                                        <DataTrigger Binding="{Binding PlannedHoursForToday}" Value="{x:Null}">
                                            <Setter Property="Ellipse.Fill" Value="{StaticResource MemberTodayPlannedNullBrush}"/>
                                            <Setter Property="Ellipse.Stroke" Value="{StaticResource MemberTodayPlannedNullBorderBrush}"/>
                                        </DataTrigger>
                                        <DataTrigger Binding="{Binding IsTodayOverPlanned}" Value="True">
                                            <Setter Property="Ellipse.Fill" Value="{StaticResource MemberTodayOverPlannedBrush}"/>
                                            <Setter Property="Ellipse.Stroke" Value="{StaticResource MemberTodayOverPlannedBorderBrush}"/>
                                        </DataTrigger>
                                        <DataTrigger Binding="{Binding IsTodayHalfPlanned}" Value="True">
                                            <Setter Property="Ellipse.Fill" Value="{StaticResource MemberTodayHalfPlannedBrush}"/>
                                            <Setter Property="Ellipse.Stroke" Value="{StaticResource MemberTodayHalfPlannedBorderBrush}"/>
                                        </DataTrigger>                                        
                                    </Style.Triggers>
                                </Style>
                            </Ellipse.Style>
                        </Ellipse>

                        <Image                             
                            SF_Ext:ImageAsyncHelper.SourceUri="{Binding MemberUId, Converter={StaticResource MemberAvatarUrlConverter}}"
                               Width="{TemplateBinding Width}" Height="{TemplateBinding Height}">
                            <Image.Clip>
                                <EllipseGeometry>
                                    <EllipseGeometry.RadiusX>
                                        <Binding Path="ActualWidth" ElementName="ellipse" Converter="{StaticResource HalfValueConverter}" ConverterParameter="6"/>
                                    </EllipseGeometry.RadiusX>
                                    <EllipseGeometry.RadiusY>
                                        <Binding Path="ActualHeight" ElementName="ellipse" Converter="{StaticResource HalfValueConverter}"  ConverterParameter="6"/>
                                    </EllipseGeometry.RadiusY>
                                    <EllipseGeometry.Center>
                                        <Binding Path="ActualHeight" ElementName="ellipse" Converter="{StaticResource HalfPointConverter}"  ConverterParameter="0"/>
                                    </EllipseGeometry.Center>
                                </EllipseGeometry>                                
                            </Image.Clip>
                            <Image.Style>
                                <Style>
                                    <Style.Triggers>
                                        <DataTrigger Binding="{Binding IsContactMember}" Value="True">
                                            <Setter Property="Image.Visibility" Value="Collapsed"/>
                                        </DataTrigger>
                                        <DataTrigger Binding="{Binding IsActive}" Value="False">
                                            <Setter Property="Image.Opacity" Value="0.5"/>
                                        </DataTrigger>
                                    </Style.Triggers>
                                </Style>
                            </Image.Style>
                            <Image.ToolTip>
                                <TextBlock>
                                    <TextBlock Text="{Binding FullName}"/><LineBreak/>
                                    <TextBlock Text="{Binding PlannedHoursForToday, StringFormat={x:Static props:Resources.N_hours_of_work}}"/>
                                </TextBlock>
                            </Image.ToolTip>
                        </Image>
                    </Grid>
                    
                    
                  
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    

    <Style x:Key="MemberImageNoIndicatorControlStyle" TargetType="{x:Type ContentControl}">
        <Setter Property="Width" Value="50"/>
        <Setter Property="Height" Value="50"/>
    
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>


                    <Grid>
                        <TextBlock 
                                    x:Name="text" Visibility="Collapsed"
                                    Text="?" FontSize="30"                                    
                                    VerticalAlignment="Center" HorizontalAlignment="Center" />
                        <Ellipse 
                            x:Name="ellipse"
                            Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" StrokeThickness="0" 
                             Stroke="DarkGray" ToolTip="{Binding .}">                                                        
                        </Ellipse>
                        <Image
                            x:Name="image"
                            SF_Ext:ImageAsyncHelper.SourceUri="{Binding ., Converter={StaticResource MemberAvatarUrlConverter}}"                                
                               Width="{TemplateBinding Width}" Height="{TemplateBinding Height}">
                            <Image.Clip>
                                <EllipseGeometry>
                                    <EllipseGeometry.RadiusX>
                                        <Binding Path="ActualWidth" ElementName="ellipse" Converter="{StaticResource HalfValueConverter}"/>
                                    </EllipseGeometry.RadiusX>
                                    <EllipseGeometry.RadiusY>
                                        <Binding Path="ActualHeight" ElementName="ellipse" Converter="{StaticResource HalfValueConverter}"/>
                                    </EllipseGeometry.RadiusY>
                                    <EllipseGeometry.Center>
                                        <Binding Path="ActualHeight" ElementName="ellipse" Converter="{StaticResource HalfPointConverter}"/>
                                    </EllipseGeometry.Center>
                                </EllipseGeometry>
                            </Image.Clip>
                        </Image>
                    </Grid>
                    
                    <ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding .}" Value="{x:Null}">
                            <Setter TargetName="image" Property="Visibility" Value="Collapsed"/>
                            <Setter TargetName="text" Property="Visibility" Value="Visible"/>
                        </DataTrigger>                                                                        
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="LoadingAnimationContent" TargetType="{x:Type ContentControl}" PresentationOptions:Freeze="True">
        <Setter Property="Visibility" Value="Collapsed"/>
        <Setter Property="HorizontalAlignment" Value="Center"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="Template">            
            <Setter.Value>
                <ControlTemplate>
                    <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">                        
                        <Image
                            Source="/Images/LogoLoading.png"                
                            Stretch="None"
                            ToolTip="{x:Static props:Resources.Loading}"
                            HorizontalAlignment="Center"
                            VerticalAlignment="Center">
                            <Image.RenderTransform>
                                <ScaleTransform ScaleX="1" ScaleY="1" CenterX="0.5" CenterY="0.5"/>
                            </Image.RenderTransform>
                            <Image.Triggers>
                                <EventTrigger RoutedEvent="Image.Loaded">
                                    <EventTrigger.Actions>
                                        <BeginStoryboard>
                                            <Storyboard AutoReverse="True" RepeatBehavior="Forever" >
                                                <DoubleAnimation                                                                        
                                                Storyboard.TargetProperty="(Image.RenderTransform).(ScaleTransform.ScaleX)"                                               
                                                To="0.8"
                                                Duration="00:00:0.2"
                                                PresentationOptions:Freeze="True"/>
                                                <DoubleAnimation Storyboard.TargetProperty="(Image.RenderTransform).(ScaleTransform.ScaleY)"
                                                To="0.8"
                                                Duration="00:00:0.2"
                                                PresentationOptions:Freeze="True"/>
                                            </Storyboard>
                                        </BeginStoryboard>
                                    </EventTrigger.Actions>
                                </EventTrigger>
                            </Image.Triggers>
                        </Image>                        
                    </Grid>
                </ControlTemplate>
            
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <DataTrigger Binding="{Binding IsLoadingData}" Value="True">
                <Setter Property="Visibility" Value="Visible"/>
            </DataTrigger>
        </Style.Triggers>
    </Style>
   
 

    <Style TargetType="{x:Type SF_Helpers:DockWindowContainer}">
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
        <Setter Property="VerticalAlignment" Value="Stretch"/>
    
        <Setter Property="ChildWindows" Value="{Binding OpenedWindows}"/> 
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type SF_Helpers:DockWindowContainer}">
                    <ScrollViewer
                            HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                            x:Name="windowScrollViewer_PART"                                                
                            VerticalScrollBarVisibility="Disabled" HorizontalScrollBarVisibility="Disabled">
                        <Grid x:Name="contentGrid_PART">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>
                            <ContentPresenter
                                        Grid.Column="0" 
                                        x:Name="mainContent_PART"
                                        Content="{TemplateBinding Content}"/>
                            <SF_Helpers:ScrollViewerOffsetMediator
                                    x:Name="Mediator_PART"            
                                    ScrollViewer="{Binding ElementName=windowScrollViewer_PART}"/>
                        </Grid>
                    </ScrollViewer>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type GridSplitter}">      
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="True">
                <Setter Property="Effect">
                    <Setter.Value>
                        <DropShadowEffect Opacity="0.3" />
                    </Setter.Value>
                </Setter>
            </Trigger>
        </Style.Triggers>       
    </Style>

    <Style x:Key="AlertBorder" TargetType="{x:Type Border}">
        <Setter Property="Background" Value="{StaticResource AlertBackgroundBrush}"/>
        <Setter Property="BorderBrush" Value="{StaticResource AlertSubBrush}"/>
        <Setter Property="TextBlock.Foreground" Value="{StaticResource AlertBrush}"/>
        <Setter Property="BorderThickness" Value="2"/>
        <Setter Property="CornerRadius" Value="0"/>
        <Setter Property="Padding" Value="4"/>                
    </Style>

    <Style x:Key="ToolBarInsideBorder" TargetType="{x:Type Border}">
        <Setter Property="Margin" Value="5,0,0,0"/>
        <Setter Property="Padding" Value="5,0,0,0"/>
        <Setter Property="CornerRadius" Value="0"/>
        <Setter Property="BorderThickness" Value="1,0,0,0"/>
        <Setter Property="BorderBrush">
            <Setter.Value>
                <SolidColorBrush Color="{StaticResource Green1Color}"/>
            </Setter.Value>
        </Setter>
     
        <Setter Property="Background" Value="Transparent"/>
    </Style>

   


    <Style x:Key="ItemActionMenu" TargetType="{x:Type DockPanel}">
        <Setter Property="DockPanel.Visibility" Value="Collapsed"/>
        <Setter Property="HorizontalAlignment" Value="Right"/>
        <Setter Property="VerticalAlignment" Value="Bottom"/>
        <Setter Property="Background" Value="Transparent"/>
        <Setter Property="Margin" Value="0,3,3,0"/>
        <Style.Triggers>
            <DataTrigger Binding="{Binding Path=IsMouseOver, RelativeSource={RelativeSource AncestorType={x:Type ListBoxItem}}}" Value="True">
                <Setter Property="DockPanel.Visibility" Value="Visible"/>
            </DataTrigger>                                    
        </Style.Triggers>
    </Style>

    <Style x:Key="PostItBorder" TargetType="{x:Type Border}">
        <Setter Property="CornerRadius" Value="0"/>
        <Setter Property="Padding" Value="2"/>
        <Setter Property="Background" Value="{StaticResource PostItBackground}"/>
        <Setter Property="BorderBrush" Value="{StaticResource PostItBorderBrush}"/>
        <Setter Property="Effect">
            <Setter.Value>
                <DropShadowEffect Opacity="0.2" ShadowDepth="2"/>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <DataTrigger Binding="{Binding Task.TaskType}" Value="3">
                <Setter Property="Background" Value="{StaticResource PostItImpedimentBackground}"/>
                <Setter Property="BorderBrush" Value="{StaticResource PostItImpedimentBorderBrush}"/>
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="PostItBorderNoVM" TargetType="{x:Type Border}">
        <Setter Property="CornerRadius" Value="4"/>
        <Setter Property="Padding" Value="2"/>
        <Setter Property="Background" Value="{StaticResource PostItBackground}"/>
        <Setter Property="BorderBrush" Value="{StaticResource PostItBorderBrush}"/>
        <Setter Property="Effect">
            <Setter.Value>
                <DropShadowEffect Opacity="0.2" ShadowDepth="2"/>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <DataTrigger Binding="{Binding TaskType}" Value="3">
                <Setter Property="Background" Value="{StaticResource PostItImpedimentBackground}"/>
                <Setter Property="BorderBrush" Value="{StaticResource PostItImpedimentBorderBrush}"/>
            </DataTrigger>
        </Style.Triggers>
    </Style>



    <Style x:Key="NewItemPanelAutoClose" TargetType="Grid" >
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
        <Setter Property="Height" Value="0"/>
        <Setter Property="TextBlock.Foreground" Value="{StaticResource LabelBrush}" />
        <Style.Triggers>
            <EventTrigger RoutedEvent="LostKeyboardFocus">                
                <BeginStoryboard>
                    <Storyboard>
                        <DoubleAnimation Storyboard.TargetProperty="Height" To="0" Duration="00:00:00.3" />                        
                    </Storyboard>
                </BeginStoryboard>            
            </EventTrigger>
            <EventTrigger RoutedEvent="GotKeyboardFocus">
                <BeginStoryboard>
                    <Storyboard>
                        <DoubleAnimation Storyboard.TargetProperty="Height" To="65" Duration="00:00:00.3" />
                    </Storyboard>
                </BeginStoryboard>
            </EventTrigger>
            <!--<EventTrigger RoutedEvent="GotFocus">
                <BeginStoryboard>
                    <Storyboard>
                        <DoubleAnimation Storyboard.TargetProperty="Height" To="65" Duration="00:00:00.3" />
                    </Storyboard>
                </BeginStoryboard>
            </EventTrigger>-->
        </Style.Triggers>
    </Style>
    
    <Style x:Key="PluginMenuItems" TargetType="ItemsControl">
        <Setter Property="ItemsSource" Value="{Binding PluginMenuItems}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="ItemsControl">
                    <Border x:Name="border" Style="{StaticResource ToolBarInsideBorder}">                        
                        <StackPanel IsItemsHost="True" Orientation="Horizontal"/>                        
                    </Border>
                    <ControlTemplate.Triggers>
                        <DataTrigger  Binding="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=Items.Count}" Value="0">
                            <Setter TargetName="border" Property="Visibility" Value="Collapsed"/>
                        </DataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="ItemTemplate">
            <Setter.Value>
                <DataTemplate>
                    <MenuItem
                        Header="{Binding MenuItemHeader}"
                        IsCheckable="{Binding IsCheckable}" IsChecked="{Binding IsChecked}"
                        Command="{Binding OnClickCommand}"
                        CommandParameter="{Binding  Model, ElementName=thisView}">
                        <MenuItem.Icon>
                            <Image Source="{Binding MenuItemIconUrl}" Width="32" Height="32"/>
                        </MenuItem.Icon>                        
                    </MenuItem>
                </DataTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="SimpleLinkExpander" TargetType="{x:Type Expander}">
        <Setter Property="Margin" Value="0,0,0,0"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Expander}">
                    <StackPanel Orientation="Vertical" Margin="{TemplateBinding Margin}">
                        <ToggleButton        
                                x:Name="button"
                                Content="{TemplateBinding Header}"                                
                                Cursor="Hand"              
                                Margin="4,0,0,4"
                                IsChecked="{Binding Path=IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}">
                            <ToggleButton.Template>
                                <ControlTemplate TargetType="{x:Type ToggleButton}">
                                    <TextBlock Style="{StaticResource HyperLinkTextBlock}" FontSize="{StaticResource TinyFontSize}" Text="{TemplateBinding Content}"/>                                                                            
                                </ControlTemplate>
                            </ToggleButton.Template>
                        </ToggleButton>
                        <ContentPresenter x:Name="Content"/>                        
                    </StackPanel>
                    <ControlTemplate.Triggers>
                        <Trigger Property="Header" Value="{x:Null}">
                            <Setter TargetName="button" Property="Visibility" Value="Collapsed" />
                        </Trigger>
                        <Trigger Property="IsExpanded" Value="True">
                            <Setter TargetName="Content" Property="Visibility" Value="Visible" />
                        </Trigger>
                        <Trigger Property="IsExpanded" Value="False">
                            <Setter TargetName="Content" Property="Visibility" Value="Collapsed" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style  TargetType="{x:Type ToolTip}">
        <Setter Property="Background" Value="{StaticResource ToolTipBackgroundBrush}"/>
        <Setter Property="Foreground" Value="White"/>
        <Setter Property="BorderBrush" Value="{StaticResource ToolTipBorderBrush}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Padding" Value="4"/>        
        <Setter Property="FontSize" Value="{StaticResource NormalFontSize}"/>
    </Style>

 

</ResourceDictionary>
    
    
    